<?php
use app\assets\OrderformAsset;
use yii\helpers\Html;
use yii\helpers\Url;

OrderformAsset::register($this);
?>
<div class="form-group col-md-12 ">

    <div class="col-md-12">
        <div class="col-md-8">
            <label class="control-label" for="input01">代理申请链接</label>
            <div class="controls">
                <input value="<?= Html::encode($baseUrl) ?>web/share?user_id=<?= Html::encode($model) ?>" class="form-control " id="input01" readonly >
            </div>
        </div>
        <div class="col-md-3">
            <button class="btn btn-primary" style="margin-top: 24px" onclick="copyUrl2()">点击复制链接</button>
        </div>
    </div>

    <div class="col-md-12">
        <div class="col-md-8">
            <label class="control-label" for="input01">商城首页链接</label>
            <div class="controls">
                <input value="<?= Html::encode($baseUrl) ?>web/home?user_id=<?= Html::encode($model) ?>" class="form-control " id="input02" readonly >
            </div>
        </div>
        <div class="col-md-3">
            <button class="btn btn-primary" style="margin-top: 24px" onclick="copyUrlhome()">点击复制链接</button>
        </div>
    </div>

    <div class="col-md-12">
        <div class="col-md-4">
            <img style="margin-top: 20px" src="<?php $url = $baseUrl.'web/share?user_id='.$model;
            echo 'http://qr.liantu.com/api.php?&bg=ffffff&fg=000&w=300&text='.$url;?>"/>
        </div>
        <div class="col-md-6" style="margin-top: 150px">
            <p style="font-size: 25px;margin-left: 30px">代理申请二维码</p>
        </div>
    </div>


    <div class="col-md-12">
        <div class="col-md-4">
            <img style="margin-top: 20px" src="<?php  $url = $baseUrl.'web/home?user_id='.$model;
            echo 'http://qr.liantu.com/api.php?&bg=ffffff&fg=000&w=300&text='.$url;?>"/>
        </div>
        <div class="col-md-6" style="margin-top: 150px;">
            <p style="font-size: 25px;margin-left: 30px">商城首页二维码,分享链接顾客下单你就将获得佣金.</p>
        </div>
    </div>


</div>

<script>

    function copyUrl2()
    {
        var Url2=document.getElementById("input01");
        Url2.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令
        alert("已复制好,将链接发给代理");
    }

    function copyUrlhome(){

        var url = document.getElementById('input02');
        url.select();
        document.execCommand("Copy"); // 执行浏览器复制命令
        alert("已复制好,将链接发给代理");

    }

</script>